﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes {
    import flash.events.*;
    import Engine.Managers.*;
    import Events.*;
    import Display.DialogUI.*;
    import Display.*;

    public class XPromoFriend extends Friend {

        private var m_action:String = "";
        private var m_config:Object;

        public function XPromoFriend(_arg1:Object){
            this.m_config = {};
            super(null, 0, 0, 0, false, null, "", null, null, null, 0, true, true);
            m_firstTimeVisit = false;
            this.m_config = _arg1;
            m_name = ZLoc.t("XPromo", _arg1.nameKey);
            this.m_action = _arg1.action;
            m_profilePic = String(_arg1.profilePic);
        }
        override public function get socialLevel():int{
            return (0);
        }
        override public function get uid():String{
            return ("-2");
        }
        override public function get xp():int{
            return (int.MAX_VALUE);
        }
        override public function get level():int{
            return (-1);
        }
        override public function get avatar():Object{
            return (null);
        }
        override public function get cityname():String{
            return (m_name);
        }
        override public function get fake():Boolean{
            return (true);
        }
        override public function get empty():Boolean{
            return (false);
        }
        public function get acceptButtonLocKey():String{
            return ((("xpromo_" + this.m_config.nameKey) + "_accept"));
        }
        public function get neighborBarLocKey():String{
            return ((("xpromo_" + this.m_config.nameKey) + "_neighborbar"));
        }
        public function get configObj():Object{
            return (this.m_config);
        }
        public function onXPromo(_arg1:MouseEvent):void{
            var title:* = null;
            var message:* = null;
            var url:* = null;
            var dialogue:* = null;
            var e:* = _arg1;
            if (e){
                e.stopImmediatePropagation();
                e.stopPropagation();
            };
            var callback:* = function (_arg1:GenericPopupEvent):void{
                if (_arg1.button == GenericPopup.YES){
                    GlobalEngine.socialNetwork.redirect((("xpromo.php?action=" + m_action) + "&source=neighbor"), null, "_blank");
                };
            };
            switch (this.m_action){
                default:
                    title = ZLoc.t("Announcements", (("Announcement" + this.m_config.nameKey) + "_title"));
                    message = ZLoc.t("Announcements", (("Announcement" + this.m_config.nameKey) + "_text"));
                    url = (("assets/announcements/announcement_" + this.m_config.nameKey) + ".png");
                    dialogue = new GenericPictureDialog(message, "", GenericPopup.TYPE_OK, callback, title, "", true, 0, this.acceptButtonLocKey, url);
                    UI.displayPopup(dialogue, false);
            };
            StatsManager.count("xpromo", this.m_config.nameKey, "dialog_redirect");
        }

    }
}//package Classes 
